package ClassesFieldsMethods;

public class AuctionPerson 
{
	String name;
	boolean haveCar = false;
	int numOfCars = 0;
	
	void checkCarsPosession()
	{
		if(haveCar == true)
		{
			numOfCars++;
		}
		if(numOfCars > 2)
		{
			System.out.println("ТThis person can't buy more cars.");
		}
	}
	
	
	void buy(boolean buy)
	{
		for (int i = 0; i < 10; i++) 
		{
			System.out.println();//generira samo sluchaini chisla sas stoinost 1 ili 2
			if((Math.round(Math.random()) + 1 == 1))
			{
				buy = true;
		
			}
			else
			{
				buy = false;
			}
		}
	}
}
